package operation;

import book.Book;
import book.BookList;

import java.util.Scanner;

public class Find implements IOPer{
    @Override
    public void work(BookList bookList) {
        System.out.println("查找");
        Scanner scanner = new Scanner(System.in);
        String find = scanner.nextLine();
        int sz = bookList.getUsersize();
        for (int i = 0; i < sz; i++) {
            Book book = bookList.getBook(i);
            if(book.getName().equals(find)){
                System.out.println("成功找到图书");
                System.out.println(book);
                return;
            }
        }
        System.out.println("未找到图书");
    }
}
